import java.util.Random;
import java.util.Scanner;

public class Work5 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Random random = new Random();

        int countUser = 0;
        int countComputer = 0;

        System.out.println("程序已启动");
        System.out.println("剪刀  石头  布");
        for (int i = 0; i < 5; i++) {
            System.out.println("第" + (i + 1) + "局");
            String user = scanner.next();
            int computer = random.nextInt(3) + 1;
            if (computer == 1) {
                if (user.equals("剪刀")) {
                    System.out.println("平局");
                } else if (user.equals("石头")) {
                    System.out.println("你赢了");
                    countUser++;
                } else {
                    System.out.println("你输了");
                    countComputer++;
                }
            } else if (computer == 2) {
                if (user.equals("剪刀")) {
                    System.out.println("你输了");
                    countComputer++;
                } else if (user.equals("石头")) {
                    System.out.println("平局");
                } else {
                    System.out.println("你赢了");
                    countUser++;
                }
            } else {
                if (user.equals("剪刀")) {
                    System.out.println("你赢了");
                    countUser++;
                } else if (user.equals("石头")) {
                    System.out.println("你输了");
                    countComputer++;
                } else {
                    System.out.println("平局");
                }
            }
        }
        System.out.println("本次游戏你赢了" + countUser + "局" + "平了" + (5 - countComputer - countUser));
        if (countComputer < countUser) {
            System.out.println("你赢了");
        } else if (countComputer > countUser) {
            System.out.println("你输了");
        } else {
            System.out.println("平局");
        }
    }
}
